package cn.itcast.feign.client;

import cn.itcast.feign.config.DefaultFeignConfiguration;
import cn.itcast.feign.pojo.Result;
import cn.itcast.feign.pojo.Room;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "room-service", configuration = DefaultFeignConfiguration.class)
public interface RoomClient {
    @PostMapping("/room/add")
    public Result save(@RequestBody Room room);

    @DeleteMapping("/room/{roomId}")
    public Result delete(@PathVariable Integer roomId);

    @PutMapping("/room/update")
    public Result update(@RequestBody Room room);

    @PostMapping("room/inquire")
    public Room select(@RequestBody Long roomId);
}
